PIM Dense Mode

Published: 2021-12-22

The simplest operating mode. A router will forward multicast traffic to its PIM neighbors unless it receives a Prune-message asking it to stop. If a Prune message is received then the interface the message was received on will be removed from the list of outgoing interfaces for the (S,G) flow. Received IGMP join messages on the LAN interface will stop PIM from sending out Prune messages for that group.

Initial Configuration and Topology

Interface fa0/0 on each router connects to its local PC. Here we have IGMPv3 enabled. Interface fa1/0 and fa2/0 connect to the other routers, creating a ring topology. We use OSPF to exchange unicast routes.

ip multicast-routing
!
interface FastEthernet0/0
 description LAN
 ip address 10.0.1.1/24
 ip igmp version 3
 ip ospf 1 area 0
!
interface FastEthernet1/0
 description R1-R2 link
 ip address 10.1.2.1/24
 ip ospf 1 area 0
!
interface FastEthernet2/0
 description R1-R3 link
 ip address 10.1.3.1/24
 ip ospf 1 area 0

ip multicast-routing
!
interface FastEthernet0/0
 description LAN
 ip address 10.0.2.1/24
 ip igmp version 3
 ip ospf 1 area 0
!
interface FastEthernet1/0
 description R1-R2 link
 ip address 10.1.2.2/24
 ip ospf 1 area 0
!
interface FastEthernet2/0
 description R2-R3 link
 ip address 10.2.3.2/24
 ip ospf 1 area 0

ip multicast-routing
!
interface FastEthernet0/0
 description LAN
 ip address 10.0.3.1/24
 ip igmp version 3
 ip ospf 1 area 0
!
interface FastEthernet1/0
 description R1-R3 link
 ip address 10.1.3.3/24
 ip ospf 1 area 0
!
interface FastEthernet2/0
 description R2-R3 link
 ip address 10.2.3.3/24
 ip ospf 1 area 0

interface FastEthernet0/0
 ip address 10.0.1.11 255.255.255.0
!
ip route 0.0.0.0 0.0.0.0 10.0.1.1

interface FastEthernet0/0
 ip address 10.0.2.22 255.255.255.0
!
ip route 0.0.0.0 0.0.0.0 10.0.2.1

interface FastEthernet0/0
 ip address 10.0.2.33 255.255.255.0
!
ip route 0.0.0.0 0.0.0.0 10.0.3.1


Enabling PIM Dense-mode

We apply the configuration below to enable PIM on all router interfaces. This tells the routers to send out PIM hello messages and form adjacencies that are used to exchange PIM Join/Leave messages and elect a designated forwarder to avoid multicast packet duplication, more on this below. Finally, enabling PIM on an interface also tells the router to start listening for IGMP messages, this is why we enable it on the LAN interface aswell.

interface range fa0/0,fa1/0,fa2/0
 ip pim dense-mode

R1#show ip pim neighbor
Neighbor  Interface
10.1.2.2  FastEthernet1/0
10.1.3.3  FastEthernet2/0

R1#show ip igmp groups

R1#show ip mroute 239.1.1.1

interface range fa0/0,fa1/0,fa2/0
 ip pim dense-mode

R2#show ip pim neigh
Neighbor  Interface
10.1.2.1  FastEthernet1/0
10.2.3.3  FastEthernet2/0

R2#show ip igmp groups

R2#show ip mroute 239.1.1.1

interface range fa0/0,fa1/0,fa2/0
 ip pim dense-mode

R3#show ip pim neigh
Neighbor  Interface
10.1.3.1  FastEthernet1/0
10.2.3.2  FastEthernet2/0

R3#show ip igmp groups

R3#show ip mroute 239.1.1.1

PIM adjacencies are established, but no multicast information has yet been exchanged. Let's change that.

PC11 now starts generating multicast traffic to 239.1.1.1 with a simple ping. Let's see the reaction of each router when they receive this multicast traffic. We run the command debug ip pim to capture the PIM process output shown below:

PC11#ping 239.1.1.1    
...

PIM(0): Received v2 Join/Prune on FastEthernet1/0 from 10.1.2.2, to us
PIM(0): Prune-list: (10.0.1.11/32, 239.1.1.1) 
PIM(0): Prune FastEthernet1/0/239.1.1.1 from (10.0.1.11/32, 239.1.1.1)
PIM(0): Received v2 Join/Prune on FastEthernet2/0 from 10.1.3.3, to us
PIM(0): Prune-list: (10.0.1.11/32, 239.1.1.1) 
PIM(0): Prune FastEthernet2/0/239.1.1.1 from (10.0.1.11/32, 239.1.1.1)

R1#show ip mroute 239.1.1.1
IP Multicast Routing Table

(*, 239.1.1.1), 00:00:09/stopped, RP 0.0.0.0, flags: D
  Incoming interface: Null, RPF nbr 0.0.0.0
  Outgoing interface list:
    FastEthernet2/0, Forward/Dense, 00:00:09/stopped
    FastEthernet1/0, Forward/Dense, 00:00:09/stopped

(10.0.1.11, 239.1.1.1), 00:00:09/00:02:50, flags: PT
  Incoming interface: FastEthernet0/0, RPF nbr 0.0.0.0
  Outgoing interface list:
    FastEthernet1/0, Prune/Dense, 00:00:09/00:02:50
    FastEthernet2/0, Prune/Dense, 00:00:09/00:02:50

PIM(0): Received v2 Assert on FastEthernet2/0 from 10.2.3.3
PIM(0): Assert metric to source 10.0.1.11 is [110/2]
PIM(0): We lose, our metric [110/2]
PIM(0): Prune FastEthernet2/0/239.1.1.1 from (10.0.1.11/32, 239.1.1.1)
PIM(0): Insert (10.0.1.11,239.1.1.1) prune in nbr 10.1.2.1's queue
PIM(0): Insert (10.0.1.11,239.1.1.1) prune in nbr 10.2.3.3's queue
PIM(0): Send (10.0.1.11, 239.1.1.1) PIM-DM prune to oif FastEthernet2/0 in Prune state
PIM(0): (10.0.1.11/32, 239.1.1.1) oif FastEthernet2/0 in Prune state
PIM(0): Building Join/Prune packet for nbr 10.2.3.3
PIM(0):  Adding v2 (10.0.1.11/32, 239.1.1.1) Prune
PIM(0): Send v2 join/prune to 10.2.3.3 (FastEthernet2/0)
PIM(0): Building Join/Prune packet for nbr 10.1.2.1
PIM(0):  Adding v2 (10.0.1.11/32, 239.1.1.1) Prune
PIM(0): Send v2 join/prune to 10.1.2.1 (FastEthernet1/0)

R2#show ip mroute 239.1.1.1
IP Multicast Routing Table

(*, 239.1.1.1), 00:00:09/stopped, RP 0.0.0.0, flags: D
  Incoming interface: Null, RPF nbr 0.0.0.0
  Outgoing interface list:
    FastEthernet2/0, Forward/Dense, 00:00:09/stopped
    FastEthernet1/0, Forward/Dense, 00:00:09/stopped

(10.0.1.11, 239.1.1.1), 00:00:09/00:02:50, flags: PT
  Incoming interface: FastEthernet1/0, RPF nbr 10.1.2.1
  Outgoing interface list:
    FastEthernet2/0, Prune/Dense, 00:00:09/00:02:50

PIM(0): Send v2 Assert on FastEthernet2/0 for 239.1.1.1, source 10.0.1.11, metric [110/2]
PIM(0): Assert metric to source 10.0.1.11 is [110/2]
PIM(0): We win, our metric [110/2]
PIM(0): Schedule to prune FastEthernet2/0
PIM(0): (10.0.1.11/32, 239.1.1.1) oif FastEthernet2/0 in Forward state
PIM(0): Received v2 Join/Prune on FastEthernet2/0 from 10.2.3.2, to us
PIM(0): Prune-list: (10.0.1.11/32, 239.1.1.1) 
PIM(0): Prune FastEthernet2/0/239.1.1.1 from (10.0.1.11/32, 239.1.1.1)
PIM(0): Insert (10.0.1.11,239.1.1.1) prune in nbr 10.1.3.1's queue
PIM(0): Building Join/Prune packet for nbr 10.1.3.1
PIM(0):  Adding v2 (10.0.1.11/32, 239.1.1.1) Prune
PIM(0): Send v2 join/prune to 10.1.3.1 (FastEthernet1/0)

R3#show ip mroute 239.1.1.1
IP Multicast Routing Table

(*, 239.1.1.1), 00:00:09/stopped, RP 0.0.0.0, flags: D
  Incoming interface: Null, RPF nbr 0.0.0.0
  Outgoing interface list:
    FastEthernet2/0, Forward/Dense, 00:00:09/stopped
    FastEthernet1/0, Forward/Dense, 00:00:09/stopped

(10.0.1.11, 239.1.1.1), 00:00:09/00:02:50, flags: PT
  Incoming interface: FastEthernet1/0, RPF nbr 10.1.3.1
  Outgoing interface list:
    FastEthernet2/0, Prune/Dense, 00:00:09/00:02:50, A

We can see that R1 created two multicast routing table entries, one for (*,239.1.1.1) and one for (10.0.1.11, 239.1.1.1). Let's focus on the latter (S,G) entry. The traffic was received from 10.0.1.11 on the fa0/0 interface and forwarded out on fa1/0 and fa2/0 to R2 and R3, its downstream PIM neighbors. Shortly after, prune messages were received from both R2 and R3.

R2 receive the (10.0.1.11,239.1.1.1) multicast traffic from R1 on fa1/0 and create two multicast routing entries, (*,G) and (S,G). The (S,G) route has outgoing interface fa2/0 to downstream PIM neighbor R3, so R2 forward the packet to R3, triggering an assert election. No prune message have been generated yet.

R3 receives the multicast traffic from R1 on fa1/0 and forwards it to its downstream PIM neighbor R2. R3 also receive the multicast traffic from R2, triggering an assert election. No prune message have been generated yet.

PIM Assert election

The floody nature of Dense Mode causes both R2 and R3 to send out the same packet on the R2-R3 link, causing packet duplication. If another PC was connected to this link, it would receive both packets, potentially causing issues. To avoid this, an assert election is held between R2 and R3 to decide who gets to send out the multicast packets on the R2-R3 link. R3 wins the election based on these election criteria:

  1. The router with the lowest administrative distance to the multicast source wins.

    Both R2 and R3 have distance 110 (OSPF) so this one is a tie.

  2. If AD is equal then lowest metric wins.

    This is also a tie as R1 is one hop away for both R2 and R3.

  3. If metric is equal then highest IP address wins.

    R3 wins with 10.2.3.3 vs R2's lower 10.2.3.2 IP address.

R3 will be the one forwarding multicast packets out on R2-R3 link.

Dense Mode Pruning

After losing the assert election, R2 stops forwarding the multicast traffic out on the fa2/0 interface. R2 is still receiving the same multicast traffic from R1 and R3. The traffic from R3 fails the uRPF check so R2 sends a prune message to R3. R2 now has no active interfaces in the outgoing interfaces list because R2 has no downstream devices interested in the traffic, so it sends a Prune message to R1.

R3 receives the prune message from R2 and realizes it does not have any downstream devices interested, so it sends its own Prune message to R1. The multicast tree has now been successfully pruned and the multicast traffic from PC11 stops at R1.

Let's look at what happens after PC22 joins the 239.1.1.1 multicast group.

PC22 join the 239.1.1.1 group

PC22 is configured to join the multicast group.

interface FastEthernet0/0
 ip address 10.0.2.22 255.255.255.0
 ip igmp join-group 239.1.1.1
 ip igmp version 3
!
ip route 0.0.0.0 0.0.0.0 10.0.2.1

IGMP(0): Received v3 Report for 1 group on FastEthernet0/0 from 10.0.2.22
IGMP(0): MRT Add/Update FastEthernet0/0 for (*,239.1.1.1) by 0

R2#show ip mroute
IP Multicast Routing Table

(*, 239.1.1.1), 00:01:00/00:02:14, RP 0.0.0.0, flags: DC
  Incoming interface: Null, RPF nbr 0.0.0.0
  Outgoing interface list:
    FastEthernet2/0, Forward/Dense, 00:01:00/stopped
    FastEthernet1/0, Forward/Dense, 00:01:00/stopped
    FastEthernet0/0, Forward/Sparse, 00:01:00/00:02:14

The debug output show how PC22 sends an IGMP membership report message to R2 who creates a (*,239.1.1.1) entry in its multicast routing table. If R2 receives traffic destined to 239.1.1.1 it now knows that devices on interface fa0/0 is interested in receiving it.

We tell PC11 to start the multicast ping packets again to see how our routers react.

PC11#ping 239.1.1.1
Reply to request 0 from 10.0.2.22, 132 ms
Reply to request 1 from 10.0.2.22, 12 ms
Reply to request 2 from 10.0.2.22, 28 ms

PIM(0): Received v2 Join/Prune on FastEthernet2/0 from 10.1.3.3, to us
PIM(0): Prune-list: (10.0.1.11/32, 239.1.1.1) 
PIM(0): Prune FastEthernet2/0/239.1.1.1 from (10.0.1.11/32, 239.1.1.1)

R1#show ip mroute 239.1.1.1
IP Multicast Routing Table

(*, 239.1.1.1), 00:00:17/stopped, RP 0.0.0.0, flags: D
  Incoming interface: Null, RPF nbr 0.0.0.0
  Outgoing interface list:
    FastEthernet2/0, Forward/Dense, 00:00:17/stopped
    FastEthernet1/0, Forward/Dense, 00:00:17/stopped

(10.0.1.11, 239.1.1.1), 00:00:17/00:02:42, flags: T
  Incoming interface: FastEthernet0/0, RPF nbr 0.0.0.0
  Outgoing interface list:
    FastEthernet1/0, Forward/Dense, 00:00:17/stopped
    FastEthernet2/0, Prune/Dense, 00:00:17/00:02:42

PIM(0): Received v2 Assert on FastEthernet2/0 from 10.2.3.3
PIM(0): Assert metric to source 10.0.1.11 is [110/2]
PIM(0): We lose, our metric [110/2]
PIM(0): Prune FastEthernet2/0/239.1.1.1 from (10.0.1.11/32, 239.1.1.1)
PIM(0): Insert (10.0.1.11,239.1.1.1) prune in nbr 10.2.3.3's queue
PIM(0): Send (10.0.1.11, 239.1.1.1) PIM-DM prune to oif FastEthernet2/0 in Prune state
PIM(0): (10.0.1.11/32, 239.1.1.1) oif FastEthernet2/0 in Prune state
PIM(0): Building Join/Prune packet for nbr 10.2.3.3
PIM(0):  Adding v2 (10.0.1.11/32, 239.1.1.1) Prune
PIM(0): Send v2 join/prune to 10.2.3.3 (FastEthernet2/0)

R2#show ip mroute 239.1.1.1
IP Multicast Routing Table

(*, 239.1.1.1), 00:07:20/stopped, RP 0.0.0.0, flags: DC
  Incoming interface: Null, RPF nbr 0.0.0.0
  Outgoing interface list:
    FastEthernet2/0, Forward/Dense, 00:07:20/stopped
    FastEthernet1/0, Forward/Dense, 00:07:20/stopped
    FastEthernet0/0, Forward/Sparse, 00:07:20/00:02:50

(10.0.1.11, 239.1.1.1), 00:00:17/00:02:42, flags: T
  Incoming interface: FastEthernet1/0, RPF nbr 10.1.2.1
  Outgoing interface list:
    FastEthernet0/0, Forward/Sparse, 00:00:17/00:02:50
    FastEthernet2/0, Prune/Dense, 00:00:17/00:02:42

PIM(0): Send v2 Assert on FastEthernet2/0 for 239.1.1.1, source 10.0.1.11, metric [110/2]
PIM(0): Assert metric to source 10.0.1.11 is [110/2]
PIM(0): We win, our metric [110/2]
PIM(0): Schedule to prune FastEthernet2/0
PIM(0): (10.0.1.11/32, 239.1.1.1) oif FastEthernet2/0 in Forward state
PIM(0): Received v2 Join/Prune on FastEthernet2/0 from 10.2.3.2, to us
PIM(0): Prune-list: (10.0.1.11/32, 239.1.1.1) 
PIM(0): Prune FastEthernet2/0/239.1.1.1 from (10.0.1.11/32, 239.1.1.1)
PIM(0): Insert (10.0.1.11,239.1.1.1) prune in nbr 10.1.3.1's queue
PIM(0): Building Join/Prune packet for nbr 10.1.3.1
PIM(0):  Adding v2 (10.0.1.11/32, 239.1.1.1) Prune
PIM(0): Send v2 join/prune to 10.1.3.1 (FastEthernet1/0)

R3#show ip mroute 239.1.1.1
IP Multicast Routing Table

(*, 239.1.1.1), 00:00:17/stopped, RP 0.0.0.0, flags: D
  Incoming interface: Null, RPF nbr 0.0.0.0
  Outgoing interface list:
    FastEthernet2/0, Forward/Dense, 00:00:17/stopped
    FastEthernet1/0, Forward/Dense, 00:00:17/stopped

(10.0.1.11, 239.1.1.1), 00:00:17/00:02:42, flags: PT
  Incoming interface: FastEthernet1/0, RPF nbr 10.1.3.1
  Outgoing interface list:
    FastEthernet2/0, Prune/Dense, 00:00:17/00:02:42, A

This time things are a little different. R1 still receives a prune message from R3, but not from R2. R2 and R3 still hold an assert election that R3 wins. R2 only sends a prune message to R3 this time. Lastly, PC22 successfully receives and responds to the ping packets from PC11!

PC33 join the 239.1.1.1 multicast group

We now configure PC33 to also receive the multicast traffic.

interface FastEthernet0/0
 ip address 10.0.3.33 255.255.255.0
 ip igmp join-group 239.1.1.1
 ip igmp version 3
!
ip route 0.0.0.0 0.0.0.0 10.0.3.1

R3#show ip mroute

(*, 239.1.1.1), 00:01:07/00:02:41, RP 0.0.0.0, flags: DC
  Incoming interface: Null, RPF nbr 0.0.0.0
  Outgoing interface list:
    FastEthernet2/0, Forward/Dense, 00:01:07/stopped
    FastEthernet1/0, Forward/Dense, 00:01:07/stopped
    FastEthernet0/0, Forward/Dense, 00:01:07/stopped

We start sending ping packets from PC11 again. Let's see what happens:

PC11#ping 239.1.1.1
Reply to request 0 from 10.0.3.33, 212 ms
Reply to request 0 from 10.0.2.22, 312 ms
Reply to request 1 from 10.0.3.33, 16 ms
Reply to request 1 from 10.0.2.22, 20 ms
Reply to request 2 from 10.0.2.22, 16 ms
Reply to request 2 from 10.0.3.33, 44 ms

R1#show ip mroute
IP Multicast Routing Table

(*, 239.1.1.1), 00:00:50/stopped, RP 0.0.0.0, flags: D
  Incoming interface: Null, RPF nbr 0.0.0.0
  Outgoing interface list:
    FastEthernet2/0, Forward/Dense, 00:00:50/stopped
    FastEthernet1/0, Forward/Dense, 00:00:50/stopped

(10.0.1.11, 239.1.1.1), 00:00:50/00:02:09, flags: T
  Incoming interface: FastEthernet0/0, RPF nbr 0.0.0.0
  Outgoing interface list:
    FastEthernet1/0, Forward/Dense, 00:00:49/stopped
    FastEthernet2/0, Forward/Dense, 00:00:50/stopped

PIM(0): Received v2 Assert on FastEthernet2/0 from 10.2.3.3
PIM(0): Assert metric to source 10.0.1.11 is [110/2]
PIM(0): We lose, our metric [110/2]
PIM(0): Prune FastEthernet2/0/239.1.1.1 from (10.0.1.11/32, 239.1.1.1)
PIM(0): Insert (10.0.1.11,239.1.1.1) prune in nbr 10.2.3.3's queue
PIM(0): Send (10.0.1.11, 239.1.1.1) PIM-DM prune to oif FastEthernet2/0 in Prune state
PIM(0): (10.0.1.11/32, 239.1.1.1) oif FastEthernet2/0 in Prune state
PIM(0): Building Join/Prune packet for nbr 10.2.3.3
PIM(0):  Adding v2 (10.0.1.11/32, 239.1.1.1) Prune
PIM(0): Send v2 join/prune to 10.2.3.3 (FastEthernet2/0)

R2#show ip mroute
IP Multicast Routing Table

(*, 239.1.1.1), 00:19:09/stopped, RP 0.0.0.0, flags: DC
  Incoming interface: Null, RPF nbr 0.0.0.0
  Outgoing interface list:
    FastEthernet2/0, Forward/Dense, 00:19:09/stopped
    FastEthernet1/0, Forward/Dense, 00:19:09/stopped
    FastEthernet0/0, Forward/Sparse, 00:19:09/00:02:02

(10.0.1.11, 239.1.1.1), 00:00:45/00:02:14, flags: T
  Incoming interface: FastEthernet1/0, RPF nbr 10.1.2.1
  Outgoing interface list:
    FastEthernet0/0, Forward/Sparse, 00:00:45/00:02:14
    FastEthernet2/0, Prune/Dense, 00:00:45/00:02:14

PIM(0): Send v2 Assert on FastEthernet2/0 for 239.1.1.1, source 10.0.1.11, metric [110/2]
PIM(0): Assert metric to source 10.0.1.11 is [110/2]
PIM(0): We win, our metric [110/2]
PIM(0): Schedule to prune FastEthernet2/0
PIM(0): (10.0.1.11/32, 239.1.1.1) oif FastEthernet2/0 in Forward state
PIM(0): Received v2 Join/Prune on FastEthernet2/0 from 10.2.3.2, to us
PIM(0): Prune-list: (10.0.1.11/32, 239.1.1.1) 
PIM(0): Prune FastEthernet2/0/239.1.1.1 from (10.0.1.11/32, 239.1.1.1)

R3#show ip mroute
IP Multicast Routing Table

(*, 239.1.1.1), 00:04:12/stopped, RP 0.0.0.0, flags: DC
  Incoming interface: Null, RPF nbr 0.0.0.0
  Outgoing interface list:
    FastEthernet0/0, Forward/Dense, 00:02:27/stopped
    FastEthernet2/0, Forward/Dense, 00:04:12/stopped
    FastEthernet1/0, Forward/Dense, 00:04:12/stopped

(10.0.1.11, 239.1.1.1), 00:01:02/00:01:57, flags: T
  Incoming interface: FastEthernet1/0, RPF nbr 10.1.3.1
  Outgoing interface list:
    FastEthernet2/0, Prune/Dense, 00:01:02/00:01:57, A
    FastEthernet0/0, Forward/Dense, 00:01:02/stopped

Both PC22 and PC33 respond to PC11. This time we get no debug output at all from R1. This is because it received no Prune message from either R2 or R3. R2 and R3 still hold their assert election and R2 still send a prune message to R3.

Dense Mode Conclusion

To sum it up, multicast traffic is forwarded unless a Prune message is received. An upstream Prune message is generated by a router if it has no downstream devices interested in receiving this multicast flow. Because of the flooding nature of Dense mode, packet duplicate may occur before an assert election is completed.


Copyright 2021-2023, Emil Eliasson.
All Rights Reserved.